import request from './request';

//添加
export function request_create_log(params) {
    return request.post('/createLog', params)
}

//编辑
export function request_edit_log(params) {
    return request.post('/upData', params)
}
//供货公司添加
export function request_company_add(params) {
    return request.post('/supplycompany/save', params)
}

//供货公司编辑
export function request_company_edit(params) {
    return request.post('/supplycompany/edit', params)
}

//供货公司列表
export function request_company_index(params) {
    return request.post('/supplycompany/index', params)
}

//供货公司删除
export function request_company_delete(params) {
    return request.post('/supplycompany/delete', params)
}

//供货公司列表
export function request_company_read(params) {
    return request.post('/supplycompany/read', params)
}
//收货公司添加
export function request_receive_add(params) {
    return request.post('/receivecompany/save', params)
}

//收货公司编辑
export function request_receive_edit(params) {
    return request.post('/receivecompany/edit', params)
}

//收货公司列表
export function request_receive_index(params) {
    return request.post('/receivecompany/index', params)
}

//收货公司删除
export function request_receive_delete(params) {
    return request.post('/receivecompany/delete', params)
}
//收货公司列表
export function request_receive_read(params) {
    return request.post('/receivecompany/read', params)
}

//产品品名添加
export function request_product_add(params){
    return request.post('/productname/save', params)
}

//产品品名编辑
export function request_product_edit(params){
    return request.post('/productname/edit', params)
}

//产品品名列表
export function request_product_list(params){
    return request.post('/productname/index', params)
}

//产品品名删除
export function request_product_delete(params){
    return request.post('/productname/delete', params)
}

//产品品名列表
export function request_product_read(params){
    return request.post('/productname/read', params)
}

//终端用户添加
export function request_end_add(params){
    return request.post('/enduser/save', params)
}

//终端用户编辑
export function request_end_edit(params){
    return request.post('/enduser/edit', params)
}

//终端用户列表
export function request_end_list(params){
    return request.post('/enduser/index', params)
}

//终端用户删除
export function request_end_delete(params){
    return request.post('/enduser/delete', params)
}

//终端用户列表
export function request_end_read(params){
    return request.post('/enduser/read', params)
}


//采购结算
export function request_cgjsdan_add(params){
    return request.post('/cgjsdan/save', params)
}

export function request_cgjsdan_edit(params){
    return request.post('/cgjsdan/edit', params)
}

export function request_cgjsdan_list(params){
    return request.post('/cgjsdan/index', params)
}

export function request_cgjsdan_delete(params){
    return request.post('/cgjsdan/delete', params)
}

//销售结算
export function request_xsjsdan_read(params){
    request.post('/xsjsdan/read', params, { responseType: 'blob' }).then(function (response) {
        const url = window.URL.createObjectURL(new Blob([response.data]))
        const link = document.createElement('a')
        link.href = url
        link.setAttribute('download', '销售结算.xlsx')
        document.body.appendChild(link)
        link.click()
    })
}

//销售结算
export function request_cgjsdan_read(params){
    request.post('/cgjsdan/read', params, { responseType: 'blob' }).then(function (response) {
        const url = window.URL.createObjectURL(new Blob([response.data]))
        const link = document.createElement('a')
        link.href = url
        link.setAttribute('download', '采购结算.xlsx')
        document.body.appendChild(link)
        link.click()
    })
}
export function request_xsjsdan_add(params){
    return request.post('/xsjsdan/save',params);
}
export function request_xsjsdan_edit(params){
    return request.post('/xsjsdan/edit',params);
}
export function request_xsjsdan_list(params){
    return request.post('/xsjsdan/index',params)
}
export function request_xsjsdan_delete(params){
    return request.post('/xsjsdan/delete',params)
}


